home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / moden / tcom / downdir.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-04-08  |  1.7 KB  |  66 lines

  1. {$G+,X+}
  2.  
  3. {Conditional defines that may affect this unit}
  4. {$I AWDEFINE.INC}
  5.  
  6. {*********************************************************}
  7. {*                   DOWNDIR.PAS 1.01                    *}
  8. {*        Copyright (c) TurboPower Software 1995         *}
  9. {*                 All rights reserved.                  *}
  10. {*********************************************************}
  11.  
  12. unit Downdir;
  13.  
  14. interface
  15.  
  16. uses
  17.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  18.   Forms, Dialogs, StdCtrls, FileCtrl, Buttons, AdMisc, TComIni;
  19.  
  20. type
  21.   TDownloadDirectoryForm = class(TForm)
  22.     GroupBox1: TGroupBox;
  23.     DownloadDirEdit: TEdit;
  24.     DirectoryListBox: TDirectoryListBox;
  25.     DriveComboBox: TDriveComboBox;
  26.     OkBtn: TBitBtn;
  27.     CancelBtn: TBitBtn;
  28.     HelpBtn: TBitBtn;
  29.     procedure DirectoryListBoxChange(Sender: TObject);
  30.     procedure OkBtnClick(Sender: TObject);
  31.     procedure FormCreate(Sender: TObject);
  32.   private
  33.     { Private declarations }
  34.   public
  35.     { Public declarations }
  36.   end;
  37.  
  38. implementation
  39.  
  40. {$R *.DFM}
  41.  
  42. procedure TDownloadDirectoryForm.DirectoryListBoxChange(Sender: TObject);
  43. begin
  44.   DownloadDirEdit.Text := LowerCase(DirectoryListBox.Directory);
  45. end;
  46.  
  47. procedure TDownloadDirectoryForm.OkBtnClick(Sender: TObject);
  48. begin
  49.   if not IsDirectory(DownloadDirEdit.Text) then begin
  50.     MessageDlg('Invalid directory.', mtError, [mbOk], 0);
  51.     DownloadDirEdit.SetFocus;
  52.     ModalResult := mrNone;
  53.   end;
  54. end;
  55.  
  56. procedure TDownloadDirectoryForm.FormCreate(Sender: TObject);
  57. begin
  58.   if IsDirectory(DownloadDir) then
  59.     DirectoryListBox.Directory := DownloadDir
  60.   else
  61.     DirectoryListBox.Directory := '';
  62. end;
  63.  
  64. end.
  65.  
  66.